export const getTime = (isSec=true) => {
    const CNweeks = ['日','一','二','三','四','五','六']
    const date = new Date()
    let newdate = date.getDate()//xx月 newdate 日
    let newday = date.getDay()//星期 newday 
    let newhour = date.getHours()//小时
    let newminutes =date.getMinutes()//分钟
    let newmonth =date.getMonth()+1//月
    let newsec = date.getSeconds()
    let resTime
    let resWeek = `星期${CNweeks[newday]}`
    let resdate = `${newmonth}月${newdate}日`

    if(isSec){
        newhour>=10? 
        resTime=`${newhour}:${newminutes<10?`0${newminutes}`:newminutes}:${newsec<10?`0${newsec}`:newsec}` :
        resTime = `0${newhour}:${newminutes<10?`0${newminutes}`:newminutes}:${newsec<10?`0${newsec}`:newsec}`
    }else{
        newhour>=10? 
        resTime=`${newhour}:${newminutes<10?`0${newminutes}`:newminutes}` :
        resTime = `0${newhour}:${newminutes<10?`0${newminutes}`:newminutes}`
    }
    

    return {Time:resTime,Week:resWeek,date:resdate}
}
